package com.zyk.plugin;


import java.security.ProtectionDomain;

public interface JaTransformer {

    int ATTACH_MODE = 1;
    int AGENT_MODE = 2;

    /**
     * if allow in attach mode return 1
     * if allow in agent mode return 2
     * if allow both of premain and agent return 1 | 2 = 3
     * else return 0
     */
    default int mode() {
        return 3;
    }

    default String getHookClassName() {
        return null;
    }

    default String getHookPackageName() {
        return null;
    }

    default byte[] redefineClass(ClassLoader loader, String className, Class<?> classBeingRedefined,
                                 ProtectionDomain protectionDomain, byte[] classfileBuffer) {
        return null;
    }

    default byte[] loadClass(ClassLoader loader, String className,
                             ProtectionDomain protectionDomain, byte[] classfileBuffer) {
        return null;
    }


}
